Skip to content

Quick hack to account for async evens getting coalesced#15

Open
rvs wants to merge 1 commit intojvburnes:masterfrom
rvs:async
Open

Quick hack to account for async evens getting coalesced#15
rvs wants to merge 1 commit intojvburnes:masterfrom
rvs:async

Conversation

@rvs
Copy link
Copy Markdown
Contributor

@rvs rvs commented Jan 4, 2021

While playing with node9 on both Mac OS X and Linux over the holidays, I kept running into a weird issue where if I cut-n-paste any text string into the console -- the console driver would get behind a random number of characters and not deliver strings back to the shell when I pressed enter. After some investigation it turns out that libav doesn't have a guarantee that X uv_async_send events would trigger exactly X wakeups of a handler. In fact, the handler may actually get woken up anywhere between 1 and X times (but at least one is guaranteed). This, of course, explains why I would see this 'console driver getting behind issue' and suggests a very simply fix along the lines of this PR.

We should probably turn it into a proper while loop if this gets to be the way we fix this issue, but I wanted to show the idea in the smallest diff possible first.

@jvburnes please let me know WDYT

Signed-off-by: Roman Shaposhnik <rvs@zededa.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant